import React from "react";
import { observer } from "mobx-react";
import countSlice from "./store/countSlice";

function App() {
  const incrementHandler = () => {
    countSlice.increment(10);
  };
  const decrementHandler = () => {
    countSlice.decrement(5);
  };
  const decremenAsynctHandler = () => {
    countSlice.incrementAsync(18);
  };
  return (
    <div>
      <h2>{countSlice.state.count}</h2>
      <button onClick={incrementHandler}>++</button>
      <button onClick={decrementHandler}>--</button>
      <button onClick={decremenAsynctHandler}>++Async</button>
    </div>
  );
}
export default observer(App);
